package com.zygh.dlqwservice.module.controller.pc;


import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zygh.dlqwservice.common.anno.PcLog;
import com.zygh.dlqwservice.common.pcdomain.ResponseDTO;
import com.zygh.dlqwservice.constant.SwaggerTagConst;
import com.zygh.dlqwservice.module.entity.ProblemDetail;
import com.zygh.dlqwservice.module.service.IProblemDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author lee
 * @since 2020-12-24
 */
@RestController
@RequestMapping("/problem-detail")
@Api(tags = {SwaggerTagConst.Admin.PROBLEM_DETAIL})
public class ProblemDetailController {

    @Resource
    private IProblemDetailService problemDetailService;

    @PostMapping("/findDetailByType")
    @ApiOperation(value = "根据问题类型id，查询问题类型详情")
    @PcLog(logType = "1", module = SwaggerTagConst.Admin.PROBLEM_DETAIL, content = "根据问题类型id，查询问题类型详情")
    public ResponseDTO<List<ProblemDetail>> findDetailByType(Integer type) {
        List<ProblemDetail> list = problemDetailService.list(Wrappers.<ProblemDetail>lambdaQuery().eq(ProblemDetail::getType,type));
        return ResponseDTO.succData(list);
    }

}
